/**
 * SimpleFactoryPattern
 * 用于解决对象创建的问题
 */
public class SimpleFactoryPattern {
  public static void main(String[] args) {
    ChickenFactory.createChicken("CAIKUN").basketboll();
  }
}

class ChickenFactory{
    public static Chicken createChicken(String race) {
        switch (race) {
            case "CAIKUN":
                return new CAIKUN();
            case "IKUN":
                return new IKUN();
            default:
                return new CAIKUN();

        }
    }
}
interface Chicken {
    void sing();

    void dance();

    void basketboll();
}

class CAIKUN implements Chicken {
    public void sing() {
    };

    public void dance() {
    };

    public void basketboll() {
    };
}

class IKUN implements Chicken {
    public void sing() {
    };

    public void dance() {
    };

    public void basketboll() {
    };
}   